package com.tyylab.message.core.config;


import com.tyylab.message.core.service.ConcurrentSubscribeService;
import com.tyylab.message.core.service.ISubscribeSupport;
import com.tyylab.message.core.service.IUniqueSupport;
import com.tyylab.message.core.service.UniqueMessageSupportService;
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration
@ImportAutoConfiguration(classes = {RedisConfig.class})
@ComponentScan(basePackages = {"com.tyylab.message.core.config.properties"})
public class SubscribeConfig {

    @Bean
    @ConditionalOnMissingBean
    public ISubscribeSupport defaultSubscribeService(){
        return new ConcurrentSubscribeService();
    }

    @Bean
    @ConditionalOnMissingBean
    public IUniqueSupport defaultUniqueSupport(){
        return new UniqueMessageSupportService();
    }
}
